home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / AmigaUtil / ASLUtil.mod < prev    next >
Text File  |  1994-08-08  |  2KB  |  67 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: ASLUtil.mod $
  4.   Description: Support for clients of asl.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 16:11:17 $
  10.  
  11.   Copyright © 1994, Frank Copeland.
  12.   This file is part of the Oberon-A Library.
  13.   See Oberon-A.doc for conditions of use and distribution.
  14.  
  15. *************************************************************************)
  16.  
  17. MODULE ASLUtil;
  18.  
  19. (*
  20. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  21. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  22. ** $V- OvflChk       $Z- ZeroVars
  23. *)
  24.  
  25. IMPORT
  26.   SYS := SYSTEM,
  27.   U   := Utility,
  28.   I   := Intuition,
  29.          ASL;
  30.  
  31. (*------------------------------------*)
  32. (*
  33.   Simple wrapper for calling the ASL FileRequester.
  34. *)
  35.  
  36. PROCEDURE RequestFile * (
  37.   window        : I.WindowPtr;
  38.   hail          : ARRAY OF CHAR;
  39.   VAR file      : ARRAY OF CHAR;
  40.   VAR directory : ARRAY OF CHAR )
  41. : BOOLEAN;
  42.  
  43.   VAR
  44.     fr : ASL.FileRequesterPtr; result : BOOLEAN;
  45.  
  46. (* $D- disable copying of open arrays *)
  47. BEGIN (* RequestFile *)
  48.   fr := SYS.VAL (ASL.FileRequesterPtr,
  49.     ASL.base.AllocAslRequestTags
  50.       ( ASL.fileRequest,
  51.         ASL.hail,   SYS.ADR (hail),
  52.         ASL.window, window,
  53.         ASL.file,   SYS.ADR (file),
  54.         ASL.dir,    SYS.ADR (directory),
  55.         U.tagEnd ));
  56.   IF fr # NIL THEN
  57.     result := ASL.base.AslRequestTags (fr, U.tagEnd);
  58.     IF result THEN COPY (fr.drawer^, directory); COPY (fr.file^, file) END;
  59.     ASL.base.FreeAslRequest (fr)
  60.   ELSE
  61.     result := FALSE
  62.   END;
  63.   RETURN result
  64. END RequestFile;
  65.  
  66. END ASLUtil.
  67.